package com.qk.mangement.web.config;


import com.qk.mangement.web.interceptor.LoginCheckInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Date:2025/10/11
 * Author:zxc
 * Description
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
//    @Autowired
//    private MyInterceptor myInterceptor;
    @Autowired
    private LoginCheckInterceptor LoginCheckInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(myInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns("/login");
        registry.addInterceptor(LoginCheckInterceptor)
                .addPathPatterns("/**")

                .excludePathPatterns("/login", "/register", "/public/**");
    }
}
